package fr.gest4team.app.gestion.dao;

import java.util.List;

import fr.gest4team.app.gestion.dao.abstrait.AbstractGapDao;
import fr.gest4team.app.gestion.dao.interfaces.IGapDao;
import fr.gest4team.app.gestion.dto.Gap;

/**
 * Dao modifiable
 * 
 * @see fr.gest4team.app.gestion.dto.Gap
 */
public class GapDao extends AbstractGapDao implements IGapDao {

    /**
     * @author brug
     * @return retourne la liste des Gaps.
     */
    public List<Gap> chargerListeGap(final String lot, final List<String> rlf) {
        String rlfStr = "";
        for (final String r : rlf) {
            rlfStr += "'" + r + "',";
        }
        rlfStr = rlfStr.substring(0, rlfStr.length() - 1);
        final String hql = "from Gap as g " + "where g.lot=? and " + "g.gapNomAffectLot in (" + rlfStr + ") ";
        return executeHqlQuery(hql, new Object[] { lot });
    }
}